<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript" th:src="@{/js/jquery-3.3.1.js}"></script>
		<link th:href="@{/bootstrap/css/bootstrap.css}" rel="stylesheet">
		<link th:href="@{/css/myself.css}" rel="stylesheet" type="text/css"/>
		<!--<link th:href="@{/css/pill.css}" rel="stylesheet" type="text/css"/>-->

		<script th:src="@{/bootstrap/js/bootstrap.js} "></script>

		<script type="text/javascript">
			//checkbox 全选/取消全选
			var isCheckAll = false;
			function swapCheck() {
				if (isCheckAll) {
					$("input[type='checkbox']").each(function() {
						this.checked = false;
					});
					isCheckAll = false;
				} else {
					$("input[type='checkbox']").each(function() {
						this.checked = true;
					});
					isCheckAll = true;
				}
			}
		</script>
	</head>
	<body style="background-color: #F5FDF9;">

		<!-- 导航栏部分 -->
		<div th:replace="~{manager/common/commons::topbar}"></div>


		<!-- 主体部分 -->
		<div style="margin-top: 5px;width: 100%;position:absolute;top:63px;bottom: 0;">
			<!-- 左导航栏 -->
			<div th:replace="~{manager/common/commons::left}"></div>
			<!--显示部分-->

			<div style="width: 85%;text-align: center;margin-top: 5px;float: left;">
				<!-- 第一行 -->
				<div style="width:600px;margin-left: 700px;">
					<form th:action="@{/manager/select_order}">
					<div style="float: left;line-height: 30px;margin-right: 10px;">
						<p style="float: left;">
							订单编号：
						</p>
						<input name="id" placeholder="请输入订单编号" type="text" style="border-radius: 10px;border-width: 1px;outline: none;"/>
					</div>


					<div style="float: left;">
						<input type="submit" class="btn btn-info" style="outline: none;" value="查询" />
					</div>
					</form>
				</div>
				<!-- 表格信息-->
				<div>
					<table class="table table-bordered table-hover"
						   data-pagination="true"
						   data-side-pagination="client"
						   data-page-size="1">
						<thead>
						<tr class="success">
							<th style="background-color:#D1FDDE;text-align:center;border:none;"><input type="checkbox" id="checkAll" onclick="swapCheck()" name="checkAll" /></th>
							<th style="border: none;text-align: center;background-color: #D1FDDE;">订单编号</th>
							<th style="border: none;text-align: center;background-color: #D1FDDE;">药材名称</th>
							<th style="border: none;text-align: center;background-color: #D1FDDE;">用户名称</th>
							<th style="border: none;text-align: center;background-color: #D1FDDE;">购买数量</th>
							<th style="border: none;text-align: center;background-color: #D1FDDE;">订单总价</th>
							<th style="border: none;text-align: center;background-color: #D1FDDE;">订单状态</th>
							<th style="border: none;text-align: center;background-color: #D1FDDE;">操作</th>
						</tr>
						</thead>
						<tbody>
						<tr th:each="order:${orderForms}">
							<td style="text-align:center;"><input type="checkbox"  name="checkItem" /></td>
							<td th:text="${order.getId()}"></td>
							<td th:text="${order.getMedName()}"></td>
							<td th:text="${order.getUsername()}"></td>
							<td th:text="${order.getQuantity()}"></td>
							<td th:text="${order.getPrice()}"></td>
							<td th:text="${order.getState()}"></td>
							<td style="text-align:center;width: 150px;">
								<a  class="btn btn-danger" th:href="@{/manager/modify1(id=${order.getId()})}" style="float: left;margin-right: 5px;outline: none;">退货</a>
								<a  class="btn btn-success" th:href="@{/manager/modify2(id=${order.getId()})}" style="outline: none;">发货</a>
							</td>
						</tr>


						</tbody>
					</table>
				</div>
				<!-- 分页信息 -->
				<div class="panel-footer" style="text-align: center;background-color: #F5FDF9;border: none;">
					<nav>
						<ul class="pagination pagination-sm">

							<li class="disabled">
								<a href="#" aria-label="Previous">
									<span aria-hidden="true">«</span>
								</a>
							</li>
							<li th:class="${now_page==page ? 'active':'nav-link'}" th:each="page:${pages}">
								<a th:href="@{/manager/page(page=${page})}" th:text="${page}"></a>
							</li>
							<li>
								<a href="#" aria-label="Next">
									<span aria-hidden="true">»</span>
								</a>
							</li>
						</ul>
					</nav>
				</div>


		    </div>
		</div>



	</body>
</html>